﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Wolfut.MirageEE.Domain.CommonUtilities;
using Wolfut.MirageEE.Interface.Common;
using MiragePWF.Common.Container;

namespace Wolfut.MirageEE.UI.UIBaseComponents
{
    public partial class UserSubjectControl : MirageEEUserControlBase
    {
        #region private var
        private Constant.FormState formState = Constant.FormState.FORMADD;
        ISubjectsService service;
        #endregion

        #region property
        private string _subjectCategory;

        public string SubjectCategory
        {
            get { return _subjectCategory; }
            set { _subjectCategory = value; }
        }
        #endregion

        public UserSubjectControl()
        {
            InitializeComponent();
        }

        

        #region Event
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            simpleButtonChooseAll.Text = "全部";
            service = IOC.Resolve<ISubjectsService>();

            BindGridControlData();
        }

        private void SimpleButtonSave_Click(object sender, EventArgs e)
        {

        }

        private void SimpleButtonClear_Click(object sender, EventArgs e)
        {

        }

        private void gridControlSubjects_DoubleClick(object sender, EventArgs e)
        {

        }
        #endregion

        #region private method
        private void BindGridControlData()
        {
            gridControlSubjects.DataSource = service.GetSubjectsBySubjectCategory(_subjectCategory, false);
            BindFormControlData();
        }

        private void BindFormControlData()
        {
            if (this.formState == Constant.FormState.FORMUPDATED)
            {

            }
            else if (this.formState == Constant.FormState.FORMADD)
            {

            }
            else if (this.formState == Constant.FormState.FORMITEMCOPY)
            {

            }
        }
        #endregion

        #region 临时处理用
        /// <summary>
        /// 种类下拉框
        /// </summary>
        private void InitCategoryCombox()
        { 
        
        }

        /// <summary>
        /// 辅助核算
        /// </summary>
        private void InitAssistCheckingCombox()
        {
        
        }

        /// <summary>
        /// 外币核算
        /// </summary>
        private void InitCurrencyCheckingCombox()
        {

        }
        #endregion

    }
}
